<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Array Copy</title>
</head>
<body>
  <script>
    let ints,
        reset = () => ints = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
    reset();
    ints.copyWithin(5);
    console.log(ints);
    reset();

    ints.copyWithin(0, 5);
    console.log(ints);
    reset();

    ints.copyWithin(4, 0, 3);
    console.log(ints);
    reset();

    ints.copyWithin(2, 0, 6);
    console.log(ints);
    reset();

    ints.copyWithin(1, -15, -12);
    console.log(ints);
    reset();

    ints.copyWithin(4, 7, 10);
    console.log(ints);  // [0, 1, 2, 3, 7, 8, 9, 7, 8, 9]
    reset();
  </script>
</body>
</html>